package com.wsq.rxjavademo.resp;


import java.util.List;

import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;

/**
 * Date:2022/11/24
 * Time:21:53
 * author:wushengqi
 */
public class Model {

//    private void

    public static void getData(Callback callback){
        Observable.create(new ObservableOnSubscribe<List<Integer>>() {
            @Override
            public void subscribe(ObservableEmitter<List<Integer>> observableEmitter) throws Exception {

//                observableEmitter.onNext(CacheRes.getIntance().getCache());
            }
        }).subscribeOn(Schedulers.io())
          .observeOn(AndroidSchedulers.mainThread())
          .subscribe(new Observer<List<Integer>>() {
              @Override
              public void onSubscribe(Disposable disposable) {

              }

              @Override
              public void onNext(List<Integer> strings) {

              }

              @Override
              public void onError(Throwable throwable) {

              }

              @Override
              public void onComplete() {

              }
          });
    }

    public interface Callback{
        void callback();
    }

    private void getDataD(){

    }
}
